
attribute vec3 pos;
attribute vec2 texcoord;
attribute vec3 normal;


uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 NormalMatrix;

varying vec3 V_Normal;
varying vec4 V_WorldPos;
varying vec2 V_Texcoord;

void main()
{
	V_Normal=mat3(NormalMatrix)*normal;
	V_WorldPos=ModelMatrix*vec4(pos,1.0)+vec4(offset,1.0);
	V_Texcoord=texcoord;
    gl_Position=ProjectionMatrix*V*V_WorldPos;
}